package com.it.bigdata.course.utils;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
//jedis操作类
public class JedisUtil {
     //构造方法私有化
     private static JedisPool jedisPool;
     private JedisUtil(){};
     static {
       jedisPool =new JedisPool("node1",6379);
     }
     public static Jedis getJedis(){
       Jedis jedis = jedisPool.getResource();
       return jedis;
     }
     public static  void closeJedis(Jedis jedis){
         jedis.close();
     }
}
